
#include <ddk.h>
#include <zenr_api.h>

Uint32 zenr_PSendAndWaitHandle(void *D, int Handle)
{
    DzEvent event;
    WaitResult wr;

    *(Uint32*)D = (Uint32)&event; // T_ZENR_*->completionEvent

    int ret = zapi_System->vsi_c_psend(D, Handle);
    if (0 == ret) {
        event.Wait(&wr, NULL);
    }
    else {
        assert(0 && "zenr_System->vsi_c_psend failed.\n");
    }

    return ret;
}

Uint32 zenr_PSendHandle(void *D, int Handle)
{
    *(Uint32*)D = 0;

    int ret = zapi_System->vsi_c_psend(D, Handle);

    if (0 != ret) {
        assert(0 && "zenr_System->vsi_c_psend failed.\n");
    }

    return ret;
}

